gesturesingle: Add missing documentation
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 9 Apr 2014 16:27:50 +0000 (18:27 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Fri, 23 May 2014 17:54:27 +0000 (19:54 +0200)
gtk/gtkgesturesingle.c

index 1f871c3cc41438a7f79d97e8f22b346f23d3c6c3..00443f2f4997f6845fe874546dfc2adbb1de320b 100644 (file)
  *
  * Author(s): Carlos Garnacho <carlosg@gnome.org>
  */
+
+/**
+ * SECTION:gtkgesturesingle
+ * @Short_description: Gesture especialized for mouse/single finger input
+ * @Title: GtkGestureSingle
+ *
+ * #GtkGestureSingle is an especialization of #GtkGesture, optimized (although
+ * not restricted) to dealing with mouse and single touch gestures. Under
+ * interaction, these gestures stick to the first interacting sequence, which
+ * is accessible through gtk_gesture_single_get_current_sequence() while the
+ * gesture is being interacted with.
+ *
+ * By default gestures only react to touch events, gtk_gesture_single_set_touch_only()
+ * can be used to change this default behavior. Callers may also specify
+ * a mouse button number to interact with through gtk_gesture_single_set_button().
+ */
+
 #include "config.h"
 #include <gtk/gtkgesturesingle.h>
 #include "gtkprivate.h"
@@ -188,6 +205,13 @@ gtk_gesture_single_class_init (GtkGestureSingleClass *klass)
   controller_class->reset = gtk_gesture_single_reset;
   controller_class->handle_event = gtk_gesture_single_handle_event;
 
+  /**
+   * GtkGestureSingle:touch-only:
+   *
+   * Whether the gesture handles only touch events
+   *
+   * Since: 3.14
+   */
   g_object_class_install_property (object_class,
                                    PROP_TOUCH_ONLY,
                                    g_param_spec_boolean ("touch-only",
@@ -196,6 +220,13 @@ gtk_gesture_single_class_init (GtkGestureSingleClass *klass)
                                                             " only touch events"),
                                                          TRUE,
                                                          GTK_PARAM_READWRITE));
+  /**
+   * GtkGestureSingle:button:
+   *
+   * Mouse button number to listen to, or 0 to listen for any button.
+   *
+   * Since: 3.14
+   */
   g_object_class_install_property (object_class,
                                    PROP_BUTTON,
                                    g_param_spec_uint ("button",
@@ -339,6 +370,15 @@ gtk_gesture_single_set_button (GtkGestureSingle *gesture,
   g_object_notify (G_OBJECT (gesture), "button");
 }
 
+/**
+ * gtk_gesture_single_get_current_button:
+ * @gesture: a #GtkGestureSingle
+ *
+ * Returns the button number currently interacting with @gesture, or 0 if there
+ * is none.
+ *
+ * Returns: The current button number
+ **/
 guint
 gtk_gesture_single_get_current_button (GtkGestureSingle *gesture)
 {
@@ -351,6 +391,15 @@ gtk_gesture_single_get_current_button (GtkGestureSingle *gesture)
   return priv->current_button;
 }
 
+/**
+ * gtk_gesture_single_get_current_sequence:
+ * @gesture: a #GtkGestureSingle
+ *
+ * Returns the event sequence currently interacting with @gesture,
+ * this is only meaningful if gtk_gesture_is_active() returns #TRUE.
+ *
+ * Returns: the current sequence
+ **/
 GdkEventSequence *
 gtk_gesture_single_get_current_sequence (GtkGestureSingle *gesture)
 {